<?php
/**
 * Created by PhpStorm.
 * User: xinghuo
 * Date: 2017/8/8
 * Time: 下午8:54
 */

namespace App\Http\Controllers;

use BaiduBce\Services\Bos\BosOptions;
use EasyWeChat\Foundation\Application;
use Illuminate\Http\Request;
use ZeonWang\BaiduBosClient\BosInterface;

class WechatOauthController
{
    use \App\TraitHelper\RequestHelper;

    public function callback(Request $request)
    {
        $app = new Application(config('wechat'));
        $oauth = $app->oauth;
        $user = $oauth->user();
        $request->session()->put('wechat_user', $user->toArray());
        redirect(route('report.add'));
    }

}